# -*- coding:utf-8 -*-
from utils.db_utils import DbConn
import datetime
from utils.serialization import Serialization
from app.plane.common.plane_sql import PlaneManageSql


class PlaneManageDB(object):
    def __init__(self):
        self.serialization = Serialization()
    
    def plane_list(self, body):
        params = ["page","size","session_user_id"]
        null_params = ["page","size"]
        sql = PlaneManageSql.PLANE_LIST
        ret = self.serialization.query_list(body, params, null_params, sql)
        return ret
    
    def plane_info(self,body):
        params = ["id"]
        null_params = []
        sql = PlaneManageSql.PLANE_INFO
        ret = self.serialization.query_info(body, params, null_params, sql)
        return ret
    
    def plane_list_in_project(self,body):
        params = ["page","size","session_user_id"]
        null_params = ["page","size"]
        sql = PlaneManageSql.PLANE_LIST_IN_PROJECT
        ret = self.serialization.query_list(body, params, null_params, sql)
        return ret
    
    def plane_list_all(self,body):
        params = ["page","size","session_user_id","session_company_post"]
        null_params = ["page","size"]
        sql = PlaneManageSql.PLANE_LIST_ALL
        ret = self.serialization.query_list(body, params, null_params, sql)
        return ret
